from config import HOST


class ApiTender:
    # 初始化
    def __init__(self, session):
        self.session = session
        self.__url_tender = HOST + "/trust/trust/tender"

    # 请求后台投资接口 封装
    def api_tender(self, tender_id, amount):
        # 请求参数
        data = {
            "id": tender_id,
            "depositCertificate": -1,
            "amount": amount
        }
        # 请求方法
        return self.session.post(self.__url_tender, data=data)
